<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <link rel="Bookmark" href="imgs/bai.ico"/>
    <link rel="Shortcut Icon" href="imgs/bai.ico"/>
    <title>业务模板</title>
    <style type="text/css">
        #load, #errMsg { margin-top: 20vh; text-align: center; }
        #errMsg { color: red; display: none; }
    </style>
</head>
<body>
    <div id="load">加载中，稍等...</div>
    <div id="errMsg">错误啦</div>
</body>
</html>


<script type="text/javascript" src="../h5/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../h5/js/view.js"></script>
<script type="text/javascript">
    var code = getParamByUrl('c');
    (function(){
        var load = $('#load'), errMsg = $('#errMsg');
        $.ajax({
            type: 'post',
            url: apiDomain + 'index',
            data: { code: code },
            success: function (res) {
                if (res.code < 0) {
                    load.hide();
                    errMsg.html(res.msg).show();
                    return
                }
                var type = res.data.type;
                var vname = '';
                if (type == 1) {
                    vname = 'tmp';
                } else if (type == 2) {
                    vname = 'goods';
                } else if (type == 3) {
                    vname = 'fuwu';
                } else {
                    load.hide();
                    errMsg.html('类型错误').show();
                    return
                }
                var path = vname + '.html';
                path += '?code=' + res.data.code;
                path += '&h5code=' + res.data.h5code;
                window.location.href = path;
            }
        });
    })();
</script>